package cn.bingo.yunsj.mapper;

import cn.bingo.yunsj.domain.RpModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RpModelMapper {
    int deleteByPrimaryKey(String modelId);

    int insert(RpModel record);

    RpModel selectByPrimaryKey(String modelId);

    List<RpModel> selectAll();

    int updateByPrimaryKey(RpModel record);

    int updateState(@Param("state") String state,
                    @Param("id") String id);

    List<RpModel> search(@Param("modelType") String modelType);

    List<RpModel> searchByRule(@Param("rule") String rule);

    int updateRule(@Param("modelName") String type,
                   @Param("rule") String ruleName);

    List<RpModel> searchNoRule();

    List<RpModel> selectByRuleAndState(@Param("modelType") String modelType,
                                       @Param("state") String state);

    /**
     * 删除规则与模板之间得联系
     * @param type
     * @return
     */
    int unbund(String type);
}